<?php
/**
 * Created by PhpStorm.
 * User: s.utkin
 * Date: 19.05.2015
 * Time: 14:18
 */

namespace SitemapGenerator\Generators;


use Pinenut\CombinationIterator;

abstract class BaseGenerator {

	/**
	 * @var CombinationIterator
	 */
	protected $partitionsDataProviders;

	/**
	 * @var CombinationIterator
	 */
	protected $generatorsDataProvider;

	protected $model;
	protected $type;
	protected $partitionParamsMapping;
	protected $generationParamsMapping;
	protected $conditions;
	protected $linkGenerator;


	public function __construct($params)
	{
		$this->model = isset($params['model']) ? $params['model'] : null;
		$this->type = isset($params['type']) ? $params['type'] : null;
		$this->partitionParamsMapping = isset($params['partitionParamsMapping']) ? $params['partitionParamsMapping'] : null;
		$this->generationParamsMapping = isset($params['generationParamsMapping']) ? $params['generationParamsMapping'] : null;
		$this->linkGenerator = isset($params['linkGenerator']) ? $params['linkGenerator'] : null;

		$this->partitionsDataProviders = new CombinationIterator();
		$this->generatorsDataProvider = new CombinationIterator();
	}

	public function addPartitionDataProvider(\Iterator $dataProvider)
	{
		$this->partitionsDataProviders->addIterator($dataProvider);
	}

	public function addGeneratorDataProvider(\Iterator $dataProvider)
	{
		$this->generatorsDataProvider->addIterator($dataProvider);
	}
} 